import request from "@/utils/request.js";
/**
 * 查询工厂返佣列表
 * @param params
 */
export const factoryList = query => {
  return request({
    url: "/purchase/factoryCommissionRule/pageList",
    method: "get",
    params: query
  });
};

/**
 * 设置工厂返佣列表
 * @param params
 */
export const setFactoryRatio = data => {
  return request({
    url: "/purchase/factoryCommissionRule/setFactoryRatio",
    method: "post",
    data
  });
};

/**
 * 获取工厂返佣详情
 * @param params
 */
export const getFactoryRatioDetail = data => {
  return request({
    url: "/purchase/factoryCommissionRule/getFactoryRatioDetail/" + data,
    method: "get"
  });
};

/**
 * 编辑工厂返佣
 * @param params
 */
export const updateFactoryRatio = data => {
  return request({
    url: "/purchase/factoryCommissionRule/updateFactoryRatio",
    method: "post",
    data
  });
};

/**
 * 取消工厂返佣
 * @param params
 */
export const deleteFactoryRatio = data => {
  return request({
    url: "/purchase/factoryCommissionRule/deleteFactoryRatio",
    method: "DELETE",
    params: data
  });
};

/**
 * 调整续约返佣
 * @param params
 */
export const changeRenewRatio = data => {
  return request({
    url: "/purchase/factoryCommissionRule/changeRenewRatio",
    method: "post",
    data
  });
};

/**
 * 申请人撤回审批
 * @param params
 */
export const recallApproval = data => {
  return request({
    url: "/purchase/factoryCommissionRule/recallApproval",
    method: "get",
    params: data
  });
};

/**
 * 撤销调整续约
 * @param params
 */
export const deleteRenew = data => {
  return request({
    url: "/purchase/factoryCommissionRule/deleteRenew",
    method: "get",
    params: data
  });
};

/**
 * 工厂返佣统计各状态数据量
 * @param params
 */
export const factoryCommissionRuleCount = query => {
  return request({
    url: "/purchase/factoryCommissionRule/factoryCommissionRuleCount",
    method: "get",
    params: query
  });
};

